perm filename COREWA.XGP[S77,JMC] blob sn#287067 filedate 1977-06-13 generic text, type T, neo UTF8
/LMAR=0/XLINE=3/FONT#0=BAXL30/FONT#1=BAXM30/FONT#2=BAXB30/FONT#3=SUB/FONT#4=SUP/FONT#5=BASL35/FONT#6=NGR25/FONT#7=MATH30/FONT#8=FIX25/FONT#9=GRK30



␈↓ ↓H␈↓α␈↓ ¬rCORE WAR

␈↓ ↓H␈↓␈↓ α_␈↓↓Core␈α∂War␈↓␈α∂is␈α∂a␈α⊂two-person␈α∂competitive␈α∂game␈α∂played␈α∂in␈α⊂the␈α∂memory␈α∂of␈α∂a␈α⊂computer.␈α∂ The
␈↓ ↓H␈↓winner is the player who first sets all locations in a disputed area to his player number.


␈↓ ↓H␈↓αGeneral description

␈↓ ↓H␈↓␈↓ α_Each␈α⊃player␈α⊃has␈α⊃his␈α⊃own␈α⊃display␈α⊃terminal␈α⊃on␈α⊃which␈α⊃are␈α⊃displayed␈α⊃the␈α⊃contents␈α⊃of␈α⊃100
␈↓ ↓H␈↓registers␈α⊃of␈α⊃memory␈α∩under␈α⊃his␈α⊃immediate␈α∩control.␈α⊃ He␈α⊃can␈α⊃also␈α∩change␈α⊃the␈α⊃contents␈α∩of␈α⊃these
␈↓ ↓H␈↓registers␈αdirectly␈α
-␈αas␈αfast␈α
as␈αhe␈α
can␈αtype.␈α He␈α
can␈αchange␈α
the␈αcontents␈αof␈α
other␈αregisters,␈α
but␈αthe
␈↓ ↓H␈↓change␈αis␈α
not␈αimmediately␈α
effective,␈αand␈α
he␈αcan␈α
do␈αnothing␈α
else␈αwhile␈α
he␈αwaits.␈α
 His␈αprograms␈α
can
␈↓ ↓H␈↓also display on his screen.

␈↓ ↓H␈↓␈↓ α_There␈α
are␈α
100␈α
parallel␈α
processes␈α
each␈α
of␈αwhich␈α
has␈α
a␈α
program␈α
counter␈α
and␈α
some␈αPDP-10
␈↓ ↓H␈↓type␈αaccumulators.␈α An␈αinterpreter␈αcycles␈αamong␈αthese␈αprogram␈αcounters,␈αexecuting␈αinstructions␈αin
␈↓ ↓H␈↓turn.␈α A␈αslow␈αinstruction␈αmay␈αbe␈αskipped␈αa␈αnumber␈αof␈αturns␈αbefore␈αit␈αis␈αfinally␈αexecuted.␈α
 Initially
␈↓ ↓H␈↓50 of these processes are executing "jump self" instructions in each player's area.

␈↓ ↓H␈↓␈↓ α_A␈α
player␈α
begins␈α
by␈α
typing␈α
in␈α
some␈α
programs.␈α Once␈α
a␈α
program␈α
is␈α
typed␈α
in␈α
he␈α
can␈α
start␈αit
␈↓ ↓H␈↓going␈α∂at␈α∞some␈α∂register␈α∞by␈α∂modifying␈α∞one␈α∂of␈α∞the␈α∂"jump␈α∞self"␈α∂instructions.␈α∞ Then␈α∂he␈α∞can␈α∂type␈α∞in
␈↓ ↓H␈↓another program and start it.

␈↓ ↓H␈↓␈↓ α_His␈α∂programs␈α⊂can␈α∂write␈α⊂new␈α∂programs␈α∂and␈α⊂activate␈α∂them␈α⊂by␈α∂modifying␈α⊂hitherto␈α∂unused
␈↓ ↓H␈↓"jump␈α
self"␈αinstructions.␈α
 An␈αobvious␈α
way␈αa␈α
program␈α
can␈αget␈α
another␈αgoing␈α
is␈αto␈α
copy␈α
itself␈αinto
␈↓ ↓H␈↓new memory and activate the copy.

␈↓ ↓H␈↓␈↓ α_The␈α⊃primary␈α⊃means␈α∩of␈α⊃fighting␈α⊃is␈α∩to␈α⊃capture␈α⊃the␈α∩program␈α⊃counters␈α⊃under␈α∩the␈α⊃enemy's
␈↓ ↓H␈↓control.␈α⊃ Thus␈α⊃if␈α⊂one␈α⊃player␈α⊃stores␈α⊂a␈α⊃jump␈α⊃instruction␈α⊂in␈α⊃the␈α⊃other's␈α⊂program␈α⊃that␈α⊃goes␈α⊃to␈α⊂a
␈↓ ↓H␈↓location␈α∩with␈α⊃a␈α∩"jump␈α⊃self"␈α∩in␈α∩the␈α⊃attacker's␈α∩domain,␈α⊃the␈α∩attacker␈α⊃can␈α∩subsequently␈α∩use␈α⊃that
␈↓ ↓H␈↓program counter.  A player with no programs doing his will is helpless.

␈↓ ↓H␈↓␈↓ α_An␈αinstruction␈αthat␈αreferences␈α
memory␈αtakes␈αan␈αamount␈α
of␈αtime␈αproportional␈αto␈αthe␈α
distance
␈↓ ↓H␈↓between␈α∂the␈α⊂instruction␈α∂and␈α∂the␈α⊂register␈α∂referenced␈α∂unless␈α⊂there␈α∂is␈α∂a␈α⊂␈↓↓barrier␈↓␈α∂word␈α⊂between␈α∂the
␈↓ ↓H␈↓instruction␈αand␈αthe␈αdestination.␈α In␈αthat␈αcase,␈αthe␈αinstruction␈αis␈αnot␈αexecuted␈αbut␈αthe␈αlocation␈αand
␈↓ ↓H␈↓type␈αof␈α
the␈αbarrier␈α
encountered␈αare␈α
stored␈αin␈α
one␈αoc␈α
the␈αprocess's␈α
accumulators.␈α Ordinary␈α
barriers
␈↓ ↓H␈↓can␈α∞be␈α∞created␈α∂by␈α∞storing␈α∞into␈α∂registers,␈α∞and␈α∞immovable␈α∞barriers␈α∂existing␈α∞when␈α∞the␈α∂game␈α∞starts
␈↓ ↓H␈↓have␈α⊂the␈α∂effect␈α⊂of␈α∂defining␈α⊂terrain.␈α∂ A␈α⊂barrier␈α⊂word␈α∂has␈α⊂specified␈α∂contents␈α⊂and␈α∂is␈α⊂not␈α⊂a␈α∂legal
␈↓ ↓H␈↓instruction.

␈↓ ↓H␈↓␈↓ α_The␈α
addressing␈α
of␈α∞memory␈α
treats␈α
it␈α∞as␈α
a␈α
one␈α
dimensional␈α∞array,␈α
but␈α
the␈α∞distance␈α
function
␈↓ ↓H␈↓treats␈αit␈αas␈αa␈αrectangle␈α100␈αby␈α500␈αregisters␈αin␈αsize.␈α With␈αrespect␈αto␈αthis␈αgeometry,␈αthe␈αdistance␈αis
␈↓ ↓H␈↓Euclidean.

␈↓ ↓H␈↓␈↓ α_The␈αbasic␈αlanguage␈αis␈αa␈αsingle␈αaddress␈αcode␈αwith␈αeight␈αgeneral␈αregisters␈αone␈αof␈αwhich␈αis␈αthe
␈↓ ↓H␈↓program␈α⊂counter.␈α⊂ Each␈α⊂process␈α⊂has␈α⊂its␈α⊂own␈α⊂general␈α⊂registers␈α⊂and␈α⊂program␈α⊂counter␈α⊂which␈α∂are
␈↓ ↓H␈↓identified␈α
with␈αthe␈α
first␈αeight␈α
registers␈α
of␈αthe␈α
process␈αand␈α
hence␈α
can␈αbe␈α
stored␈αinto␈α
by␈α
an␈αenemy
␈↓ ↓H␈↓trying to subvert the program or by a friendly program supplying data.
␈↓ ↓H␈↓␈↓ εH␈↓ 91


␈↓ ↓H␈↓␈↓ α_While␈α↔the␈α⊗basic␈α↔language␈α↔is␈α⊗machine␈α↔language,␈α↔processes␈α⊗may␈α↔call␈α↔read-only␈α⊗LISP
␈↓ ↓H␈↓subroutines.␈α⊃ These␈α⊃subroutines␈α⊂affect␈α⊃only␈α⊃a␈α⊂specified␈α⊃area␈α⊃of␈α⊂main␈α⊃memory␈α⊃and␈α⊃can␈α⊂return
␈↓ ↓H␈↓results␈αonly␈αto␈αthe␈αgeneral␈αregisters␈αof␈αthe␈αcalling␈αprogram␈αor␈αto␈αthe␈αhuman's␈αdisplay.␈α Thus␈αLISP
␈↓ ↓H␈↓can␈αbe␈αused␈αfor␈α
thinking␈αbut␈αnot␈αfor␈α
action.␈α Each␈αplayer␈αhas␈αa␈α
quota␈αof␈αLISP␈αmemory␈α
and␈αcan
␈↓ ↓H␈↓write␈α
subroutines␈α
in␈α
it␈α
before␈α
the␈α
game␈α
starts.␈α
 The␈α
purpose␈α
of␈α
the␈α
LISP␈α
is␈α
to␈α
allow␈αmore␈α
elaborate
␈↓ ↓H␈↓strategies␈α∞than␈α∞can␈α∞be␈α
conveniently␈α∞implemented␈α∞in␈α∞machine␈α
language.␈α∞ The␈α∞entry␈α∞points␈α∞to␈α
the
␈↓ ↓H␈↓LISP␈αsubroutines␈αare␈α
in␈αthe␈αplayer's␈α
home␈αarea␈αso␈α
his␈αadvance␈αguards␈α
think␈αmore␈αslowly␈αthan␈α
the
␈↓ ↓H␈↓generals at home.

␈↓ ↓H␈↓␈↓ α_␈↓↓Corewar␈↓␈αis␈αlikely␈αto␈αwant␈αa␈αlot␈αof␈αcomputer␈αmemory.␈α In␈αorder␈αto␈αsave␈αmemory,␈αit␈αis␈αdivided
␈↓ ↓H␈↓into␈α
blocks.␈α
 If␈αthere␈α
has␈α
been␈α
no␈αactivity␈α
in␈α
a␈α
block␈αin␈α
a␈α
long␈α
time,␈αit␈α
reverts␈α
to␈α
a␈αstandard,␈α
briefly
␈↓ ↓H␈↓described state, and the extra memory is garbage collected.


␈↓ ↓H␈↓αThe intellectual character of the game

␈↓ ↓H␈↓␈↓ α_␈↓↓Corewar␈↓␈αis␈αintended␈αto␈αbe␈αa␈αgame␈αadmitting␈αvery␈αsubtle␈αstrategies␈αwith␈αas␈αmuch␈αintelligence
␈↓ ↓H␈↓as␈α
the␈α
players␈αcan␈α
devise␈α
and␈α
hopefully␈αgoing␈α
beyond␈α
anything␈α
the␈αdesigners␈α
of␈α
the␈α
game␈αcan␈α
now
␈↓ ↓H␈↓imagine.␈α
 Should␈α
it␈α
turn␈α
out␈α∞that␈α
a␈α
brute␈α
force␈α
strategy␈α∞is␈α
effective␈α
against␈α
all␈α
comers,␈α∞the␈α
game
␈↓ ↓H␈↓will be changed.

␈↓ ↓H␈↓␈↓ α_Effective␈αstrategies␈αfor␈αthe␈αplayers␈αare␈αconstrained␈αby␈αgeometry.␈α Since␈αa␈αlong␈αdistance␈αstore
␈↓ ↓H␈↓take␈αa␈αlong␈α
time,␈αand␈αmay␈α
encounter␈αbarriers,␈αit␈α
is␈αnot␈αfeasible␈α
to␈αdestroy␈αthe␈α
enemy␈αby␈αlong␈α
range
␈↓ ↓H␈↓bombardment␈α
of␈α
(storing␈α
into)␈α
his␈α
home␈α
territory.␈α
 Instead␈α
it␈α
is␈α
necessary␈α
to␈α
have␈α
programs␈αthat
␈↓ ↓H␈↓will␈αadvance␈αand␈αbombard␈αfrom␈αclose␈αrange.␈α Since␈αan␈αenemy␈αprogram␈αthat␈αsneaks␈αclose␈αcan␈αdo␈αa
␈↓ ↓H␈↓lot␈αof␈αdamage,␈αit␈α
is␈αnecessary␈αto␈αhave␈α
programs␈αthat␈αscan␈αas␈α
much␈αterritory␈αas␈αpossible␈α
and␈αmass
␈↓ ↓H␈↓firepower against enemy programs that sneak close.

␈↓ ↓H␈↓␈↓ α_Since␈α∞a␈α∞big␈α∞program␈α∞can␈α
be␈α∞damaged␈α∞by␈α∞changing␈α∞a␈α
single␈α∞instruction,␈α∞it␈α∞is␈α∞important␈α
to
␈↓ ↓H␈↓check␈α∂the␈α∂integrity␈α∂of␈α∂a␈α∞section␈α∂of␈α∂program␈α∂before␈α∂entering␈α∞it.␈α∂ Of␈α∂course,␈α∂the␈α∂enemy␈α∂hopes␈α∞to
␈↓ ↓H␈↓subvert␈α
a␈αlocation␈α
just␈α
before␈αyour␈α
program␈αexecutes␈α
it,␈α
but␈αhis␈α
program␈αcan't␈α
readily␈α
tell␈αwhich
␈↓ ↓H␈↓locations␈αwill␈αbe␈αactive␈αsoon.␈α A␈αprogram␈αfinding␈αitself␈αseriously␈αdamaged␈αshould␈αjump␈αback␈αto␈αa
␈↓ ↓H␈↓home program, lest it be subverted.

␈↓ ↓H␈↓␈↓ α_If␈α⊃an␈α⊂enemy␈α⊃program␈α⊂can␈α⊃be␈α⊂inspected␈α⊃and␈α⊂understood,␈α⊃it␈α⊂can␈α⊃perhaps␈α⊂be␈α⊃modified␈α⊂to
␈↓ ↓H␈↓sabotage␈α∩the␈α∩enemy␈α∩undetected.␈α⊃ A␈α∩side␈α∩may␈α∩require␈α⊃commissar␈α∩programs␈α∩to␈α∩check␈α∩its␈α⊃other
␈↓ ↓H␈↓programs for orthodoxy.  Subverting a commissar may win big.

␈↓ ↓H␈↓␈↓ α_The␈αrules␈αconcerning␈αthe␈αtime␈αrequired␈αcreate␈αbarriers␈αwill␈αbe␈αdesigned␈αso␈αas␈αto␈αmake␈αthem
␈↓ ↓H␈↓useful but not dominant.

␈↓ ↓H␈↓␈↓ α_The␈αterrain␈αimposed␈αby␈αthe␈αinitial␈αbarriers␈αis␈αunknown␈αto␈αthe␈αplayers.␈α It␈αmay␈αbe␈αexplored
␈↓ ↓H␈↓by programs.

␈↓ ↓H␈↓␈↓ α_Initially,␈αwe␈αsuppose␈α
that␈αplayers␈αwill␈α
have␈αto␈αdo␈α
all␈αcomplex␈αthinking␈α
themselves.␈α Success
␈↓ ↓H␈↓will come from delegating more and more complex tasks to the soldier programs.
␈↓ ↓H␈↓␈↓ εH␈↓ 92


␈↓ ↓H␈↓αSpectators

␈↓ ↓H␈↓␈↓ α_␈↓↓Corewar␈↓␈α
can␈α
be␈α∞a␈α
good␈α
spectator␈α∞sport.␈α
 Registers␈α
are␈α
colored␈α∞according␈α
to␈α
the␈α∞player␈α
who
␈↓ ↓H␈↓last␈αaffected␈αthem␈αand␈αalso␈αaccording␈αto␈αwho␈αlast␈αlooked␈αat␈αthem␈αand␈αthese␈αcolors␈αfade␈αwith␈αtime.
␈↓ ↓H␈↓When␈α
one␈α
player␈α
stores␈α
into␈α
a␈α
program␈α
belonging␈α
to␈α
another␈α
and␈α
that␈α
instruction␈α
is␈αexecuted,␈α
then
␈↓ ↓H␈↓the␈αsubsequently␈α
executed␈αinstructions␈α
suddenly␈αchange␈αcolor.␈α
 The␈αplayers␈α
will␈αhave␈αsimilar␈α
maps
␈↓ ↓H␈↓affecting the regions they know about.

␈↓ ↓H␈↓␈↓ α_At␈αthe␈αStanford␈αAI␈αLab,␈αthe␈αintent␈α
would␈αbe␈αto␈αhave␈α␈↓↓Corewar␈↓␈αrun␈αin␈αthe␈α
PDP-11/45␈αwith
␈↓ ↓H␈↓the␈αzonker␈αmemory␈αso␈αas␈αto␈αnot␈αinterfere␈αwith␈αthe␈αKL-10.␈α It␈αwould␈αbe␈αa␈αstand-alone␈αprogram␈αas
␈↓ ↓H␈↓far as the PDP-11 is concerned and would be the lowest priority use of the PDP-11.

␈↓ ↓H␈↓John McCarthy
␈↓ ↓H␈↓Artificial Intelligence Laboratory
␈↓ ↓H␈↓Computer Science Department
␈↓ ↓H␈↓Stanford University
␈↓ ↓H␈↓Stanford, California 94305

␈↓ ↓H␈↓ARPANET: MCCARTHY@SU-AI

␈↓ ↓H␈↓␈↓ α_␈↓εThis draft of COREWA[S77,JMC] PUBbed at 17:43 on June 13, 1977.␈↓